/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import { Entity, PrimaryColumn, Column } from "typeorm";
//import { PrizePrimaryKey } from "./PrizePrimaryKey"

@Entity({ schema: "lottery", name: "l_prize" })
export class PrizeEntity {
	
//    @Column(type => PrizePrimaryKey, {prefix: "p"})
//    id: PrizePrimaryKey;
	
	// 这个地方联合主键定义还是比较糟糕
	
    @PrimaryColumn({name: "p_bid", type: "varchar", length: 40 })
    bid: string;
	
    @PrimaryColumn({name: "p_pid", type: "integer" })
    pid: number;
	
	
	@Column({name: "p_name", type: "varchar", length: 50 })
	name: string;
	
	@Column({name: "p_worth", type: "decimal", precision : 18, scale : 2, nullable: true })
	worth: number;
	
	@Column({name: "p_amount", type: "integer", nullable: true })
	amount: number;
	
	
	@Column({name: "p_detail", type: "varchar", length: 200, nullable: true })
	detail: string;
	
	@Column({name: "p_picture", type: "varchar", length: 50, nullable: true })
	picture: string;
	
}
